#ifndef HEVAKE_SOCKS5_PROTO_H
#define HEVAKE_SOCKS5_PROTO_H

namespace hevake {
namespace socks5 {

#define PROTO_VER   0x05

//! 方法
enum PROTO_METHOD {
  PROTO_METHOD_NO_AUTH = 0x00,
  PROTO_METHOD_GSSAPI  = 0x01,
  PROTO_METHOD_USERNAME_PASSWORD = 0x02,
  PROTO_METHOD_IANA_ASSIGNED_BEGIN = 0x03,
  PROTO_METHOD_IANA_ASSIGNED_END = 0x7f,
  PROTO_METHOD_RESERVED_BEGIN = 0x80,
  PROTO_METHOD_RESERVED_END = 0xfe,
  PROTO_METHOD_NO_ACCEPTABLE_METHOD = 0xff
};

//! 命令码
enum PROTO_CMD {
  PROTO_CMD_CONNECT = 0x01,
  PROTO_CMD_BIND = 0x02,
  PROTO_CMD_UDP_ASSOCIATE = 0x03,
};

//! 地址类型
enum PROTO_ATYP {
  PROTO_ATYP_IPV4 = 0x01,
  PROTO_ATYP_DOMAINNAME = 0x03,
  PROTO_ATYP_IPV6 = 0x04,
};

//! 回复码
enum PROTO_REP {
  PROTO_REP_SUCCEEDED = 0x00,
  PROTO_REP_SERVER_FAILURE = 0x01,
  PROTO_REP_NOT_ALLOW_BY_RULESET = 0x02,
  PROTO_REP_NETWORK_UNREACHABLE = 0x03,
  PROTO_REP_HOST_UNREACHABLE = 0x04,
  PROTO_REP_CONN_REFUSED = 0x05,
  PROTO_REP_TTL_EXPIRED = 0x06,
  PROTO_REP_PROTO_CMD_NOT_SUPPORT = 0x07,
  PROTO_REP_ADDR_TYPE_NOT_SUPPORT = 0x08,
};

}
}

#endif //HEVAKE_SOCKS5_PROTO_H
